(* Content-type: application/vnd.wolfram.mathematica *)

(*** Wolfram Notebook File ***)
(* http://www.wolfram.com/nb *)

(* CreatedBy='Mathematica 8.0' *)

(*CacheID: 234*)
(* Internal cache information:
NotebookFileLineBreakTest
NotebookFileLineBreakTest
NotebookDataPosition[       157,          7]
NotebookDataLength[     25857,        646]
NotebookOptionsPosition[     24302,        593]
NotebookOutlinePosition[     24647,        608]
CellTagsIndexPosition[     24604,        605]
WindowFrame->Normal*)

(* Beginning of Notebook Content *)
Notebook[{
Cell[BoxData[
 RowBox[{
  StyleBox[
   RowBox[{
    StyleBox["(*",
     FontColor->RGBColor[0.5, 0, 0.5]], 
    StyleBox[" ",
     FontColor->RGBColor[0.5, 0, 0.5]], 
    RowBox[{
     RowBox[{
      RowBox[{
       StyleBox["this",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox[" ",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox["is",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox[" ",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox["how",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox[" ",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox["PCA",
        FontColor->RGBColor[0, 0, 1]], 
       StyleBox[" ",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox["works",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox[" ",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox["in",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox[" ",
        FontColor->RGBColor[0.5, 0, 0.5]], 
       StyleBox["math",
        FontColor->RGBColor[0.5, 0, 0.5]]}], 
      StyleBox["...",
       FontColor->RGBColor[0.5, 0, 0.5]]}], 
     StyleBox[".",
      FontColor->RGBColor[0.5, 0, 0.5]]}], 
    StyleBox["*)",
     FontColor->RGBColor[0.5, 0, 0.5]]}],
   FontSize->16], "\[IndentingNewLine]", 
  RowBox[{"(*", 
   RowBox[{
    RowBox[{"cv", "=", 
     RowBox[{"Eigenvalues", "[", 
      RowBox[{"Chop", "[", 
       RowBox[{"Covariance", "[", "sample", "]"}], "]"}], "]"}]}], ";", "\n", 
    RowBox[{"vp", "=", 
     RowBox[{"Chop", "[", 
      RowBox[{"Eigenvectors", "[", 
       RowBox[{"Chop", "[", 
        RowBox[{"Covariance", "[", "sample", "]"}], "]"}], "]"}], "]"}]}], 
    ";", "\[IndentingNewLine]", 
    RowBox[{"(*", " ", 
     RowBox[{
      RowBox[{"sample", " ", "is", " ", "raw"}], ",", " ", 
      RowBox[{"so", " ", "transpose", " ", "vp"}]}], "*)"}], 
    "\[IndentingNewLine]", 
    RowBox[{"ppc", "=", 
     RowBox[{"Chop", "[", 
      RowBox[{
       RowBox[{"sample", "[", 
        RowBox[{"[", "1", "]"}], "]"}], ".", 
       RowBox[{"vp", "\[Transpose]"}]}], "]"}]}], ";", "\[IndentingNewLine]", 
    RowBox[{"kk", "=", 
     RowBox[{"Table", "[", 
      RowBox[{
       RowBox[{"If", "[", 
        RowBox[{
         RowBox[{
          RowBox[{"ppc", "[", 
           RowBox[{"[", "i", "]"}], "]"}], "<", "0"}], ",", 
         RowBox[{"-", "1"}], ",", "1"}], "]"}], ",", 
       RowBox[{"{", 
        RowBox[{"i", ",", 
         RowBox[{"Length", "[", "ppc", "]"}]}], "}"}]}], "]"}]}], ";", 
    "\[IndentingNewLine]", 
    RowBox[{"stm", "=", 
     RowBox[{"DiagonalMatrix", "[", "kk", "]"}]}], ";", "\[IndentingNewLine]", 
    RowBox[{"tvp", "=", 
     RowBox[{
      RowBox[{"vp", "\[Transpose]"}], ".", "stm"}]}], ";", 
    "\[IndentingNewLine]", 
    RowBox[{"(*", " ", 
     RowBox[{
      RowBox[{"result", " ", "is", " ", "also", " ", "raw"}], "-", "wised"}], 
     "*)"}], "\[IndentingNewLine]", 
    RowBox[{"ppc1", "=", 
     RowBox[{"Chop", "[", 
      RowBox[{"sample", ".", "tvp"}], "]"}]}], ";", "\[IndentingNewLine]", 
    RowBox[{"Dimensions", "[", "ppc1", "]"}]}], "*)"}]}]], "Input",
 CellChangeTimes->{{3.508578082515625*^9, 3.508578119765625*^9}, {
   3.508578186125*^9, 3.5085782006875*^9}, 3.508628677609375*^9}],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", " ", 
   RowBox[{"build", " ", "a", " ", "set", " ", "of", " ", "sample"}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{
    RowBox[{"s1", "=", 
     RowBox[{"RandomVariate", "[", 
      RowBox[{
       RowBox[{"MultinormalDistribution", "[", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{"1", ",", "1"}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{"0.1", ",", "0"}], "}"}], ",", 
           RowBox[{"{", 
            RowBox[{"0", ",", "0.1"}], "}"}]}], "}"}]}], "]"}], ",", "100"}], 
      StyleBox["]", "DesignDiscussion"]}]}], 
    StyleBox[";", "DesignDiscussion"]}], "\n", 
   RowBox[{
    RowBox[{"s2", "=", 
     RowBox[{"RandomVariate", "[", 
      RowBox[{
       RowBox[{"MultinormalDistribution", "[", 
        RowBox[{
         RowBox[{"{", 
          RowBox[{
           RowBox[{"-", "1"}], ",", 
           RowBox[{"-", "1"}]}], "}"}], ",", 
         RowBox[{"{", 
          RowBox[{
           RowBox[{"{", 
            RowBox[{"0.1", ",", "0"}], "}"}], ",", 
           RowBox[{"{", 
            RowBox[{"0", ",", "0.1"}], "}"}]}], "}"}]}], "]"}], ",", "100"}], 
      StyleBox["]", "DesignDiscussion"]}]}], 
    StyleBox[";", "DesignDiscussion"]}], "\[IndentingNewLine]", 
   StyleBox[
    RowBox[{"Dimensions", "[", "s2", "]"}], "DesignDiscussion"]}]}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{{3.508628683765625*^9, 3.508628695015625*^9}, {
   3.508628808671875*^9, 3.508628832078125*^9}, {3.508628945078125*^9, 
   3.50862895909375*^9}, {3.50862901815625*^9, 3.50862902490625*^9}, {
   3.508629057265625*^9, 3.50862908190625*^9}, 3.508629141953125*^9, 
   3.509878276015625*^9}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"100", ",", "2"}], "}"}]], "Output",
 CellChangeTimes->{3.50862915278125*^9, 3.508908071171875*^9, 
  3.509853199109375*^9, 3.509853232203125*^9, 3.5098782775625*^9}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ListPlot", "[", 
  RowBox[{"{", 
   RowBox[{"s1", ",", "s2"}], "}"}], "]"}]], "Input",
 CellChangeTimes->{{3.50862883521875*^9, 3.508628856609375*^9}, {
  3.5086291150625*^9, 3.50862911771875*^9}}],

Cell[BoxData[
 GraphicsBox[{
   {Hue[0.67, 0.6, 0.6], PointBox[CompressedData["
1:eJwVlGdUVAcChRlRowKrFFlaBEsIKGsjHiywF1nAEhRYBFEpCUIYBBsiiLrM
BlkCxpGRRQTZRdoMokNRuhQhYbDACkgJRKkzMJnCzHuPKQzFhP1xz/13z/nO
+c7dGHLx72HLtLS0Qpfy/+7zef9itlCE/S+idzuYjCOh66zvvLcGl1x3Psr+
WoNPVo/oqT8I4V+StCfT6hUuTbZXJURK8UZX+fHTiAadAfuDBiNFCO9O5NC/
UIE20pFc1ClCFqPUX1RLorLUhOlVPQ0r45NsRw6JpgdezXkLSjj7XtRwV/CR
EnCfZzYtQfseT9sbfCVGB7bHmXhQ0GMYZn1wJbFsc+wpylYIvZL1rn00Em+z
Ofb0YDEcI378zOAggeAdATmsBxK4W7KKh2lijD3JrVRukmBrweLbUy4fMV/Y
f73iOoV2fnydzz818M3htd7tk4GzvMayds0kVlhUZSYVSeF4Nv0C98cpdO9q
deZyKIwayfdlvJejoylneGcXiQaP7rW65gpo7bn9ZPN6GUzyV27kzxK4+Ta2
ZXwTiVqN9hGXbgLpkS12CV6zuFZWGmQ2LMYXUXkhNfEzqGr0abd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1PpV5
9SSFag19eebvWjhYzrByTunAS4qKdXCTYMC6QZ6wk8SP5Xkutm4UqL+m1jzO
I2Bwut7aeWYBoYlmu0TxSnSIGNUlRjp8WVXh5PIVBeP8jaeKoMJ1ulfAR3wV
/kV9zl/dqAIxYmMovCJDeSOT41QkRijNu7RntxJtuaVOx3RqpB3a3ZZuLECC
3jP92RkVeP7CdZc+peC8u7dlqmYRnGt2fzziijAkF64rMZei3mzScJuFAq4/
DHs47BGDt5mfJdgrRjJL9fC5SIpvggpTGAIdJj9xtH9r4CmyaVsHVJtJ3BHp
E8q6SGQVsNIjc0kEZxj/5UmuGpklRtygEQK19XMdm+a0eEl/7ER0KDGZ3z/A
KlbDk/Gis2Rejpp0UUbahBAFlYTflkAKA6kX+1OuqBDWlHtbCy0anbrELZfX
fvKhwUr5JypovIt84s4L8eBGNe9yKImi1XMTHrFrP9T8gdPN8AWcyWbI80tn
8T9A7J1d
     "]]}},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->True,
  PlotRange->Automatic,
  PlotRangeClipping->True]], "Output",
 CellChangeTimes->{{3.5086288360625*^9, 3.508628857703125*^9}, {
   3.5086290330625*^9, 3.50862908396875*^9}, 3.508629118734375*^9, 
   3.508908072671875*^9, 3.509878280859375*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"sample", "=", 
   RowBox[{"Join", "[", 
    RowBox[{"s1", ",", "s2"}], "]"}]}], ";"}]], "Input",
 CellChangeTimes->{{3.508629179234375*^9, 3.50862918059375*^9}, {
  3.508629217390625*^9, 3.5086292350625*^9}}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{
  RowBox[{"pc", "=", 
   RowBox[{"PrincipalComponents", " ", "[", 
    RowBox[{"sample", ",", 
     RowBox[{"Method", "->", "\"\<Correlation\>\""}]}], "]"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{"Dimensions", "[", "pc", "]"}]}], "Input",
 CellChangeTimes->{{3.508908056046875*^9, 3.5089080646875*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"10", ",", "5"}], "}"}]], "Output",
 CellChangeTimes->{3.5086292535625*^9, 3.508908075796875*^9, 
  3.509853204828125*^9, 3.50985323615625*^9, 3.509878284265625*^9}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Mean", "[", "pc", "]"}]], "Input",
 CellChangeTimes->{{3.5098782869375*^9, 3.50987828878125*^9}}],

Cell[BoxData[
 RowBox[{"{", 
  RowBox[{"1.1102230246251565`*^-16", ",", 
   RowBox[{"-", "4.8572257327350596`*^-18"}], ",", "3.5214886562329185`*^-17",
    ",", "3.369700352084948`*^-17", ",", "9.97465998686664`*^-19"}], 
  "}"}]], "Output",
 CellChangeTimes->{3.5098782895*^9}]
}, Open  ]],

Cell[BoxData[{
 RowBox[{"ListPlot", "[", 
  RowBox[{"pc", "[", 
   RowBox[{"[", 
    RowBox[{"All", ",", "1"}], "]"}], "]"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"(*", " ", 
   StyleBox[
    RowBox[{
    "so", " ", "not", " ", "all", " ", "features", " ", "separate", " ", 
     "two", " ", "classes"}],
    FontColor->RGBColor[0, 0, 1]], "*)"}], " "}]}], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{
  3.50857684925*^9, {3.508629261921875*^9, 3.5086293140625*^9}, {
   3.508629551734375*^9, 3.508629579921875*^9}, 3.508908086*^9, {
   3.508909009265625*^9, 3.5089090115*^9}}],

Cell[BoxData[
 GraphicsBox[
  {Hue[0.67, 0.6, 0.6], PointBox[CompressedData["
1:eJw1VAlYzfkaPlmjxFx7TabSWCrbEGqotyglbafltJ5OZ+vYUkJC058p253K
NTHR4AjhkjuEyyj9JQadGCXqJi1UZGs9LYqZ+/T9ep6enrfv/37v973f9/1M
peuEigECgeDe37///9v/02yvOyd7fGRFtz39Ay/mdJ/41qyFsC4y1scYqsQd
hEeh1t36u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9yJD7d8GnWNspfI4fDzfIC9ULyR6BA/J2zB+51MP8VMDLP
sg//k/yEAvMNt1s8/cz8V+DbTb8Z1jc2kr4CeoMf/GxT0kv6CkD/RecxU9oP
XgGz9N4ls4cRrlFgxuWMBz3H6H0RKPGPr0qir7yj/CZKzLW+mO65g+YFJZIX
crNPRzB9JezNml0UA/pIX4m0Fe29RwKpX7US0fs0LoMs2L0qIbTcUy5yYvuv
xJnVA16c6mXvRwSudtgaTtzH7i8CzXnqXHMBm38EOqY+zWuLZv5HQHMhwIcT
sPclAuMONA/+48Ib0o/AsUHuw8rzmX4ErMrChsyzJj9rInBnbB6nO5bNX4Uj
76Pe9J2k+kxUcNh1bXJ1Fe0PVMi9cTlWdIHqk6hw9LTtZ/Nl7H1XQVphXb7r
DLs/FR7ZVotiROy9U+HWrPa9zauJX6OC2auL0bvyBHy//krsX9U3zvJ9V/5f
ru8u9Q==
    "]]},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->True,
  AxesOrigin->{0, Automatic},
  PlotRange->Automatic,
  PlotRangeClipping->True]], "Output",
 CellChangeTimes->{{3.5086292735*^9, 3.508629314578125*^9}, {
  3.50890807828125*^9, 3.508908086421875*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"ListPlot", "[", "pc", "]"}]], "Input",
 CellChangeTimes->{{3.50890901509375*^9, 3.50890901909375*^9}}],

Cell[BoxData[
 GraphicsBox[
  {Hue[0.67, 0.6, 0.6], PointBox[CompressedData["
1:eJwVlPk/FAgfgFGOVugQRbakKEOyUmk3X3RKCAm5WrmVHEXSIenOkRSiiFyJ
pZFFxtdZjhnjGhEaR6RcM+Ye17vvD8/n+Qeez6PqdtHaQ0xERKTxP/5vKd0C
Rf9eAez6TU5xdHMjfNMVZG7bwoSkoDuJQ5q9mBIUrOTtwgEpF4KIq2wZDpnr
v5ZVmoXprjNFC2kjmNAZMJp+jg3G+90CDUK/w2xAQdFu7iz4b/fq33aOAsTz
7i1SdA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SI8ck2o7JvOQ2W3LQF/6BMhqvvSnM41Fn4/mX4sl9UFxlU9ten7BBjOMZmV
bq2D6w15zxo5XNywnqquR64E5a3Z8HfbFN64qjvbqtqGe5RuaXYvcrAiXoVZ
5d6G20KKlEZ//MDgHI+QKs4gSIs3PzXomEc/ySvn9/IH0GjlN16aKh8vyTuF
rI6i4Zak+YO7VvDR3OrzUH9GJmqXpDQL0xZRmjKawhoogjWrOwI/THLw36/7
bofbBKOefnGSZeQEun1R/SlFbIfofRG7crw4ODPgGX/c9hbAFsYxD7EFJEaP
GalZNGLCCfb8SwceDn7KNfBbR8XAOPKx5ZoMzDNC7SO0WrQmPOixOyxE9/cr
Mshq7ZDrJ/Yta56PzT1W58n3a6CUs19pQxwbiZpifb1XB4BBSq/cKsLEBwQf
yo2WKeBodJNYgTwsXQylJ7CbgVxobxMhwsU3e6ceTB3oAYVnDPHPhT8RVNIm
Q+93YNpy8xU9yEAf9V2eqps7UIvmKrFbfwoPZ8W/MEjNgIZ1pAipdTyUdj8a
GSn4ji+nAn4uvBFiYVP8paMJL8H4XpkafWAaJ8T/7TfwaMbKjyWhdoVsvDCy
EffYkOBVzv7FrUd56GSxqk9s2Si69er33MsVoGTWDo9wozqk7qfbBdsJcRvJ
MHLgRz3U6LAfMvzYONKW8iRxLQ22fC8OvEcSqXZI2j67dLUX430XFAhTfDzV
8POWuu1j/B9KgMVy
    "]]},
  AspectRatio->NCache[GoldenRatio^(-1), 0.6180339887498948],
  Axes->True,
  PlotRange->Automatic,
  PlotRangeClipping->True]], "Output",
 CellChangeTimes->{3.508909021421875*^9}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"(*", " ", 
   RowBox[{"try", " ", "Sw", " ", "and", " ", "Sm"}], "*)"}], 
  "\[IndentingNewLine]", 
  RowBox[{
   RowBox[{"feature", "=", 
    RowBox[{"pc", "[", 
     RowBox[{"[", 
      RowBox[{"All", ",", "1"}], "]"}], "]"}]}], ";"}]}]], "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.},
 CellChangeTimes->{
  3.50857684925*^9, 3.50862926503125*^9, {3.508630691265625*^9, 
   3.5086306929375*^9}, {3.508630784078125*^9, 3.508630822328125*^9}, 
   3.508631262765625*^9, 3.508646513734375*^9, {3.50890894871875*^9, 
   3.508908998546875*^9}, 3.50890907628125*^9}],

Cell[CellGroupData[{

Cell[BoxData[{
 RowBox[{"Total", "[", 
  RowBox[{"feature", "[", 
   RowBox[{"[", 
    RowBox[{";;", "100"}], "]"}], "]"}], "]"}], "\[IndentingNewLine]", 
 RowBox[{"Mean", "[", 
  RowBox[{"feature", "[", 
   RowBox[{"[", 
    RowBox[{"101", ";;"}], "]"}], "]"}], "]"}]}], "Input",
 CellChangeTimes->{{3.508908978*^9, 3.5089089868125*^9}, {
  3.508909060421875*^9, 3.50890906240625*^9}, {3.5089091054375*^9, 
  3.508909138515625*^9}}],

Cell[BoxData["134.28522174841754`"], "Output",
 CellChangeTimes->{{3.508908987484375*^9, 3.508909000484375*^9}, {
  3.50890906525*^9, 3.508909077875*^9}, {3.5089091164375*^9, 
  3.508909142703125*^9}}],

Cell[BoxData[
 RowBox[{"-", "1.3428522174841755`"}]], "Output",
 CellChangeTimes->{{3.508908987484375*^9, 3.508909000484375*^9}, {
  3.50890906525*^9, 3.508909077875*^9}, {3.5089091164375*^9, 
  3.508909142703125*^9}}]
}, Open  ]],

Cell[BoxData[
 RowBox[{
  RowBox[{"Sw", "=", 
   RowBox[{
    RowBox[{"Covariance", "[", 
     RowBox[{"feature", "[", 
      RowBox[{"[", 
       RowBox[{";;", "50"}], "]"}], "]"}], "]"}], "+", 
    RowBox[{"Covariance", "[", 
     RowBox[{"feature", "[", 
      RowBox[{"[", 
       RowBox[{"51", ";;"}], "]"}], "]"}], "]"}]}]}], ";"}]], "Input",
 CellChangeTimes->{{3.50863079621875*^9, 3.50863079690625*^9}, {
   3.508630940171875*^9, 3.508630988921875*^9}, 3.508631247828125*^9}],

Cell[BoxData[{
 RowBox[{
  RowBox[{"m", "=", 
   RowBox[{"Mean", "[", "feature", "]"}]}], ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"mm", "=", 
   RowBox[{"{", 
    RowBox[{
     RowBox[{"Mean", "[", 
      RowBox[{"feature", "[", 
       RowBox[{"[", 
        RowBox[{";;", "50"}], "]"}], "]"}], "]"}], ",", 
     RowBox[{"Mean", "[", 
      RowBox[{"feature", "[", 
       RowBox[{"[", 
        RowBox[{"51", ";;"}], "]"}], "]"}], "]"}]}], "}"}]}], 
  ";"}], "\[IndentingNewLine]", 
 RowBox[{
  RowBox[{"Sb", "=", 
   RowBox[{
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"mm", "[", 
        RowBox[{"[", "1", "]"}], "]"}], "-", "m"}], ")"}], "2"], "+", 
    SuperscriptBox[
     RowBox[{"(", 
      RowBox[{
       RowBox[{"mm", "[", 
        RowBox[{"[", "2", "]"}], "]"}], "-", "m"}], ")"}], "2"]}]}], 
  ";"}]}], "Input",
 CellChangeTimes->{
  3.508631025671875*^9, {3.50863109825*^9, 3.5086311605625*^9}, {
   3.50863119265625*^9, 3.50863124440625*^9}}],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Sb", "/", "Sw"}]], "Input",
 CellChangeTimes->{{3.50863125521875*^9, 3.508631257515625*^9}}],

Cell[BoxData["1.0759310619105`"], "Output",
 CellChangeTimes->{{3.508631258703125*^9, 3.508631268296875*^9}, {
  3.508908961203125*^9, 3.50890897378125*^9}}]
}, Open  ]],

Cell[CellGroupData[{

Cell[BoxData[
 RowBox[{"Tr", "[", 
  RowBox[{"Covariance", "[", 
   RowBox[{"pc", "\[Transpose]"}], "]"}], "]"}]], "Input",
 CellChangeTimes->{{3.509853181359375*^9, 3.509853193890625*^9}, {
  3.50985325859375*^9, 3.509853265125*^9}}],

Cell[BoxData["198.99999999999994`"], "Output",
 CellChangeTimes->{
  3.509853194953125*^9, {3.509853244078125*^9, 3.50985326578125*^9}}]
}, Open  ]]
},
WindowSize->{708, 719},
WindowMargins->{{Automatic, 241}, {Automatic, -6}},
FrontEndVersion->"8.0 for Microsoft Windows (32-bit) (November 7, 2010)",
StyleDefinitions->"Default.nb"
]
(* End of Notebook Content *)

(* Internal cache information *)
(*CellTagsOutline
CellTagsIndex->{}
*)
(*CellTagsIndex
CellTagsIndex->{}
*)
(*NotebookFileOutline
Notebook[{
Cell[557, 20, 3269, 95, 310, "Input"],
Cell[3829, 117, 1763, 47, 202, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[5595, 166, 205, 4, 38, "Output"],
Cell[CellGroupData[{
Cell[5825, 174, 221, 5, 39, "Input"],
Cell[6049, 181, 4783, 84, 285, "Output"]
}, Open  ]],
Cell[10847, 268, 243, 6, 39, "Input"],
Cell[CellGroupData[{
Cell[11115, 278, 334, 8, 94, "Input"],
Cell[11452, 288, 204, 4, 38, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[11693, 297, 121, 2, 39, "Input"],
Cell[11817, 301, 278, 6, 72, "Output"]
}, Open  ]],
Cell[12110, 310, 628, 16, 67, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[12741, 328, 3181, 57, 279, "Output"],
Cell[CellGroupData[{
Cell[15947, 389, 126, 2, 39, "Input"],
Cell[16076, 393, 4495, 78, 292, "Output"]
}, Open  ]],
Cell[20586, 474, 611, 15, 67, "Input",
 CellGroupingRules->{GroupTogetherGrouping, 10000.}],
Cell[CellGroupData[{
Cell[21222, 493, 433, 11, 67, "Input"],
Cell[21658, 506, 201, 3, 38, "Output"],
Cell[21862, 511, 218, 4, 38, "Output"]
}, Open  ]],
Cell[22095, 518, 484, 13, 67, "Input"],
Cell[22582, 533, 993, 33, 121, "Input"],
Cell[CellGroupData[{
Cell[23600, 570, 116, 2, 39, "Input"],
Cell[23719, 574, 157, 2, 38, "Output"]
}, Open  ]],
Cell[CellGroupData[{
Cell[23913, 581, 234, 5, 39, "Input"],
Cell[24150, 588, 136, 2, 38, "Output"]
}, Open  ]]
}
]
*)

(* End of internal cache information *)
